package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.system.mapper.SysDictDataMapper;
import com.ruoyi.system.service.ISysDictDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 字典 业务层处理
 * 
 * @author ruoyi
 */
@Service
public class SysDictDataServiceImpl implements ISysDictDataService
{
    @Autowired
    SysDictDataMapper sysDictDataMapper;

    @Override
    public List<SysDictData> selectDictDataByType(String dictType) {
        return sysDictDataMapper.selectDictDataByType(dictType);
    }
    @Override
    public List<SysDictData> selectAllSysDictdata(String dicts) {
        return sysDictDataMapper.selectAllSysDictdata(dicts);
    }

    @Override
    public List<SysDictData> selectDictDate(SysDictData sysDictData) {
        return sysDictDataMapper.selectDictDate(sysDictData);
    }

    @Override
    public int deleteDictData(Long[] dictCode) {
        int cn=0;
        for (Long aLong : dictCode) {
            cn=sysDictDataMapper.deleteDictData(aLong);
        }
        return cn;
    }

    @Override
    public int insertDict(SysDictData sysDictData) {
        int cn=sysDictDataMapper.insertDict(sysDictData);
        return cn;
    }

    @Override
    public SysDictData selectDictCode(Long dictCode) {
        SysDictData sysDictData=sysDictDataMapper.selectDictCode(dictCode);
        return sysDictData;
    }

    @Override
    public int updateDict(SysDictData sysDictData) {
        int cn=sysDictDataMapper.updateDict(sysDictData);
        return cn;
    }
}
